package com.analysis.model;

import lombok.Data;

@Data
public class MethodDifference {
    private String methodName;
    private String signature;
    private DifferenceType type;
    private String description;
    private String apiPath;
    private String httpMethod;
    private boolean apiMethod;

    public enum DifferenceType {
        ADDED("新增"),
        MODIFIED("修改"),
        DELETED("删除");

        private final String description;

        DifferenceType(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(methodName).append(signature);
        
        if (description != null && !description.isEmpty()) {
            sb.append(" - ").append(description);
        }
        
        if (apiMethod) {
            sb.append(" [").append(httpMethod).append(" ").append(apiPath).append("]");
        }
        
        return sb.toString();
    }
}
